package com.gurun.camera.device.presenter;

import com.danale.player.content.DAudioRecord;
import com.danale.player.entity.CloudRecordDevice;
import com.danale.player.entity.MultiChannelDevice;
import com.danale.player.entity.SdRecordDevice;
import com.danale.player.window.ScreenType;
import com.gurun.camera.mvp.IBasePresenter;

public interface IVideoPresenter extends IBasePresenter {

    /**
     * init the size of player
     * @param width the width of player
     * @param factor the aspect ratio of player    (factor = width / height);
     * @param screenType the screen type of player :
     * {@link ScreenType
     * One: only a IPCamera will display on monitor screen;
     * Four: four IPCameras will display on monitor screen, and you can switch screen between one IPCamera and four IPCameras by double click screen}
     */
    void initPlay(int width, float factor, ScreenType screenType);

    /**
     * stop some operation and release some sources
     */
    void release();

    /**
     * prepare for start video
     */
    void prepare();

    /**
     * start video
     */
    void startVideo();

    /**
     * start video
     * @param visible
     */
    void startVideo(boolean visible);

    /**
     * stop video(unregister the callback of video date with sending the command of stop video)
     */
    void stopVideo();

    /**
     * stop video(unregister the callback of video date with sending the command of stop video and close the connection)
     * @param closeConnection
     */
    void stopVideo(boolean closeConnection);

    /**
     * stop video(only unregister the callback of video date without sending the command of stop video)
     */
    void stopVideoData();

    /**
     * start audio
     */
    void startAudio();

    /**
     * stop audio
     */
    void stopAudio();

    /**
     * start talk
     */
    void startTalk();

    /**
     * stop talk
     */
    void stopTalk();

    /**
     * stop record
     */
    void stopRecord();

    /**
     * set the player to mute
     * @param isSilence is silence ? true : false;
     */
    void setIsSilence(boolean isSilence);

    /**
     * click the audio button (the action is to start or to stop will be automatically identified)
     */
    void clickAudio();

    /**
     * click the talk button (the action is to start or to stop will be automatically identified)
     */
    void clickTalk();

    /**
     * click the record button (the action is to start or to stop will be automatically identified)
     */
    void clickRecord();

    /**
     * snapshot
     */
    void capture();

    void selectSubScreen(String device_id);


    void pause();
    void resume();
    int getCurrentPosition();
    int getDuration();
    void seekTo(int msic);

    void setChannel(int channel);
    void changeChannels(int[] channel);
    void setData(String id);
    void updateData(String id);

    /**
     * set data for the cloud record player
     * @param device
     */
    void setCloudPlayData(CloudRecordDevice device);

    /**
     *  set data for the disk record player
     * @param device
     */
    void setSDRecordData(SdRecordDevice device);

    void setLocalRecordData(String path);
    void setMultiChanData(MultiChannelDevice device);

    void multiply();
    void setRecordCallback(DAudioRecord.RecordCallback callback);
}
